import request from '@/utils/request';

// 供应商协议
// 列表接口
export async function protocolList(params) {
  return request(`/nsApi/suppProto/pageList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

// 更新状态：废弃
export async function protocolUpdateStatus(params) {
  return request(`/nsApi/suppProto/deleteProtocol`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

// 详情数据
export async function protocolDetail(params) {
  return request(`/nsApi/suppProto/getProtocol`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
// 供应商范围地区列表
export async function protocolAreaList(params) {
  return request(`/mgrApi/suppBusiScope/getAreaList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
// 产品列表
export async function protocolProductList(params) {
  return request(`/nsApi/suppBusiScope/getPdListBySuppAndArea`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
// 添加协议
export async function protocolAdd(params) {
  return request(`/nsApi/suppProto/insert`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
// 修改协议
export async function protocolUpdate(params) {
  return request(`/nsApi/suppProto/update`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
// 操作历史
export async function protocolHistory(params) {
  return request(`/nsApi/suppProto/getProtocolHis`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
// 供应商
export async function getSupplyNameList(params) {
  return request(`/nsApi/supplier/getListByUser`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

// 获取业务范围查看列表数据
export async function getLookList(params) {
  return request(`/mgrApi/suppBusiScope/getPageList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

// 获取供应商维护列表数据
export async function getPageList(params) {
  return request(`/mgrApi/supplier/pageList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

// 获取业务范围维护列表接口
export async function suppBusiScope(params) {
  return request(`/mgrApi/suppBusiScope/getPageList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

// 获取供应商账户管理列表接口
export async function suAccount(params) {
  return request(`/mgrApi/suAccount/pageListAccount`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

// zj
// 获取供应商列表
export async function getSuppList(params) {
  return request(`/mgrApi/supplier/getMgrSuppList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
// 获取供应商账户tab未读信息
export async function countPla(params) {
  return request(`/mgrApi/supplier/countPla`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getPdList(params) {
  return request(`/mgrApi/baseProductQuery/queryPdInfoList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getAreaPlcyParam(params) {
  return request(`/mgrApi/plcyParamMGR/queryPlcyParam`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getAreaList(params) {
  return request(`/mgrApi/mdm/baseService/getProvinceCity`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getInsLsPkgName(params) {
  return request(`/mgrApi/insLsPkg/getInsLsPkgName`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getAccuLsPkgName(params) {
  return request(`/mgrApi/accuLsPkg/getAccuLsPkgName`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function deleteMul(params) {
  return request(`/mgrApi/supplier/deleteMul`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getDetail(params) {
  return request(`/mgrApi/suppBusiScope/getSuppBusiScope`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function updateStatus(params) {
  return request(`/mgrApi/supplier/updateStatus`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getAdd(params) {
  return request(`/mgrApi/suppBusiScope/insert`, {
    method: 'POST',
    body: params,
  });
}
export async function getUpdate(params) {
  return request(`/mgrApi/suppBusiScope/update`, {
    method: 'POST',
    body: params,
  });
}
export async function getMgrSuppList(params) {
  return request(`/mgrApi/supplier/getMgrSuppList`, {
    method: 'POST',
    body: params,
  });
}

export async function getMgrSuppListByUser(params) {
  return request(`/nsApi/supplier/mgrListByUser`, {
    method: 'POST',
    body: params,
  });
}

export async function insertAccount(params) {
  return request(`/mgrApi/suAccount/insertAccount`, {
    method: 'POST',
    body: params,
  });
}

export async function updateAccount(params) {
  return request(`/mgrApi/suAccount/updateAccount`, {
    method: 'POST',
    body: params,
  });
}

export async function updateAccountStatus(params) {
  return request(`/mgrApi/suAccount/updateAccountStatus`, {
    method: 'POST',
    body: params,
  });
}

export async function deleteAccount(params) {
  return request(`/mgrApi/suAccount/deleteAccount`, {
    method: 'POST',
    body: params,
  });
}

export async function queryAccountById(params) {
  return request(`/mgrApi/suAccount/queryAccountById`, {
    method: 'POST',
    body: params,
  });
}

export async function getSuppInfo(params) {
  return request(`/mgrApi/supplier/getSuppInfo`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function insert(params) {
  return request(`/mgrApi/supplier/insert`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function insertPla(params) {
  return request(`/mgrApi/supplier/insertPla`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function getInfo(params) {
  return request(`/mgrApi/supplier/get`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function getNameList(params) {
  return request(`/mgrApi/mdSupplier/nameList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function getSupplierList(params) {
  return request(`/mgrApi/mdSupplier/get`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function updatePla(params) {
  return request(`/mgrApi/supplier/updatePla`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function update(params) {
  return request(`/mgrApi/supplier/update`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function queryNmArea(params) {
  return request(`/mgrApi/mdm/nmArea/queryNmArea`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function queryNmAreaByParent(params) {
  return request(`/mgrApi/mdm/baseService/queryNmAreaByParent`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getBankList(params) {
  return request(`/mgrApi/suppBankAccount/getList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function deleteBankMul(params) {
  return request(`/mgrApi/suppBankAccount/deleteMul`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function getBankInfo(params) {
  return request(`/mgrApi/suppBankAccount/get`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function insertBankInfo(params) {
  return request(`/mgrApi/suppBankAccount/insert`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function updateBankInfo(params) {
  return request(`/mgrApi/suppBankAccount/update`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getContactList(params) {
  return request(`/mgrApi/suppContacts/getList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function deleteContactList(params) {
  return request(`/mgrApi/suppContacts/delete`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function getContactInfo(params) {
  return request(`/mgrApi/suppContacts/get`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function insertContactsInfo(params) {
  return request(`/mgrApi/suppContacts/insert`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function updateContactsInfo(params) {
  return request(`/mgrApi/suppContacts/update`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getvatCoprName(params) {
  return request(`/mgrApi/suppInvoice/getvatCoprName`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getTaxerName(params) {
  return request(`/mgrApi/suppInvoice/getTaxerName`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getInvoiceList(params) {
  return request(`/mgrApi/suppInvoice/getInvoiceList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function deleteInvoiceMul(params) {
  return request(`/mgrApi/suppInvoice/deleteMul`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function getInvoiceInfo(params) {
  return request(`/mgrApi/suppInvoice/get`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function insertInvoiceInfo(params) {
  return request(`/mgrApi/suppInvoice/insert`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function updateInvoiceInfo(params) {
  return request(`/mgrApi/suppInvoice/update`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function fetchMailList(params) {
  return request(`/mgrApi/suppMailAddr/getList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function delMailMul(params) {
  return request(`/mgrApi/suppMailAddr/deleteMul`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function getMailInfo(params) {
  return request(`/mgrApi/suppMailAddr/get`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function insertMailInfo(params) {
  return request(`/mgrApi/suppMailAddr/insert`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function updateMailInfo(params) {
  return request(`/mgrApi/suppMailAddr/update`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function deleteBusiness(params) {
  return request(`/mgrApi/suppBusiScope/delete`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
// 获取下载模板信息
export async function getDownloadInfo(params) {
  return request(`/csApi/fileServer/downloadTemplate?tempSerType=${params.tempSerType}`);
}
// 供应商协议管理批量上传
export async function uploadFile(params) {
  return request(`/nsApi/suppProto/uploadSuppProt`, {
    method: 'POST',
    body: params,
  });
}

// 供应商获取下载模板信息
export async function getDownloadInfoSupp(params) {
  return request(`/csApi/fileServer/downloadTemplate?tempSerType=${params.tempSerType}`);
}

// 供应商批量上传
export async function uploadFileSupp(params) {
  return request(`/mgrApi/supplier/uploadSupp`, {
    method: 'POST',
    body: params,
  });
}

// 供应商业务范围获取下载模板信息
export async function getDownloadInfoScope(params) {
  return request(`/csApi/fileServer/downloadTemplate?tempSerType=${params.tempSerType}`);
}

// 供应商业务范围批量上传
export async function uploadFileScope(params) {
  return request(`/mgrApi/suppBusiScope/batch/insert`, {
    method: 'POST',
    body: params,
  });
}

// 需求1020:平台管理员获取产品接口
// export async function getPlatformPdList(params) {
//   return request(`/csApi/baseProductQuery/queryOnceFee`, {
//     method: 'POST',
//     body: {
//       ...params,
//     },
//   });
// }

export async function fetchPlatFormPdList(params) {
  return request(`/csApi/baseProductQuery/queryPdInfo`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
